package cn.iocoder.yudao.module.measure.dal.dataobject.upload;

import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 设备上传数据解析结果表
 * </p>
 *
 * @author zhengbzh
 * @date 2025-05-26 14:52:16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@Builder
@TableName("business_device_upload_data")
public class BusinessDeviceUploadData extends BaseDO {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.INPUT)
    protected Long id;


//    @TableField(value = "created_by", fill = FieldFill.INSERT)
//    protected Long createdBy;
//
//
//    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
//    protected Long updatedBy;


    /**
     * 测量点id
     */
    @TableField(value = "device_id", condition = EQUAL)
    private Long deviceId;
    /**
     * 消息id（预留，暂时不用）
     */
    @TableField(value = "message_id", condition = LIKE)
    private String messageId;
    /**
     * 协议id
     */
    @TableField(value = "protocol_id", condition = EQUAL)
    private Long protocolId;
    /**
     * 消息模板id
     */
    @TableField(value = "message_template_id", condition = EQUAL)
    private Long messageTemplateId;
    /**
     * 数据模板id
     */
    @TableField(value = "data_template_id", condition = EQUAL)
    private Long dataTemplateId;
    /**
     * 数据类型
     */
    @TableField(value = "data_type", condition = LIKE)
    private String dataType;
    /**
     * 数据值
     */
    @TableField(value = "data_value", condition = LIKE)
    private String dataValue;
    /**
     * 数据单位
     */
    @TableField(value = "data_unit", condition = LIKE)
    private String dataUnit;
    /**
     * 数据时间戳
     */
    @TableField(value = "data_timestamp", condition = EQUAL)
    private LocalDateTime dataTimestamp;


    /**
     * 租户id  用于事件广播
     */
    @TableField(exist = false)
    @Deprecated
    private Long tenantId;



}
